CRPEngine::LogOnSQLServerWithPrivateInfo
Use this class method to allow the Crystal Report Engine to "piggyback" your application's existing connection to a Server. This lowers the number of connections established by a workstation, reducing application time and network traffic. It also prevents a LogOff call from disconnecting an application's existing connection to the Server. See Remarks below.
Syntax
LogOnSQLServerWithPrivateInfo (dllName CHAR (*), FOREIGN privateInfo)
RETURNING BOOLEAN
Parameters
dllName
| Specifies the name of the Crystal Reports DLL that was used when establishing a connection to the Server when the report was first created. For example, if a report was created using an ODBC data source, specify the file name "PDSODBC.DLL". For more information on possible database DLLs, refer to Crystal Reports Developer Runtime Help (Runtime.hlp).
|
privateInfo
| Specifies the application's handle to the Server connection. In your application, a connection to the Server must already be established before this method is called. Pass the HDBC (handle to a database connection) from this connection to the privateInfo parameter.
|
Remarks
The CRPEngine::LogOnSQLServerWithPrivateInfo method can only be used with database connections established by ODBC or Q+E Library 2.0. Any other database connections cannot be accessed by this method.
To obtain an HDBC for an ODBC connection, use the following function calls (see the ODBC SDK 2.0 manual for more information):
Function Call
| Description
|
SQLAllocEnv
| Initializes the ODBC call level interface and allocates memory for an environment handle.
|
SQLAllocConnect
| Returns an ODBC HDBC. To obtain an HDBC for a Q+E Library connection, use the following function calls (see the InterSolv DataDirect Developer's Toolkit for more information).
|
qeConnect
| Opens a connection to the server.
|
qeGetODBCHdbc
| Returns the ODBC HDBC.
|
Returns
- TRUE if the call is successful.
- FALSE if the call fails.